<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
</h:head>
<h:body>
	<h:form>
 		<p:tabMenu activeIndex="5">
 	   		<p:menuitem value="RicercaPacchetto" url="search.xhtml" icon="ui-icon-search" />
    		<p:menuitem value="AreaPersonale" url="index.xhtml" icon="ui-icon-person" />
       	</p:tabMenu>
    	<br/>
    	<p:panel header="DATI ATTUALI UTENTE">
			<h:panelGrid columns="1" id="regGrid">
    ID Login: #{userBean.getCid()}<br/>
	Nome : #{userBean.getName()} <br/>
	Cognome : #{userBean.getLastName()}<br/>
	Email : #{userBean.getEmail()}<br/><br/>
	</h:panelGrid></p:panel>
		<p:panel header="Modifica Dati">
			<h:panelGrid columns="3" id="regGrid2">
				<h:outputLabel for="email">New Email:</h:outputLabel>
				<p:inputText id="email" value="#{userBean.user.email}" />
				<p:message for="email" />

				<h:outputLabel for="firstName">New First name:</h:outputLabel>
				<p:inputText id="firstName" value="#{userBean.user.firstName}" />
				<p:message for="firstName" />

				<h:outputLabel for="lastName">New Last name:</h:outputLabel>
				<p:inputText id="lastName" value="#{userBean.user.lastName}" />
				<p:message for="lastName" />

				<h:outputLabel for="password">New Password:</h:outputLabel>
				<p:password id="password" value="#{userBean.user.password}"
					feedback="true" match="pwd2" label="Password"/>
				<p:message for="password" />

				<h:outputLabel for="pwd2">Confirm New Password:</h:outputLabel>
				<p:password id="pwd2" label="Confirm Password" value="#{userBean.user.password}"/>
			</h:panelGrid>
			<p:commandButton value="Salva" update="regGrid2"
				action="#{userBean.modify()}" />

		</p:panel>
	</h:form>
</h:body>
</html>